{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "88be5776-4573-4ed6-9dd5-28960cab3b26",
   "metadata": {},
   "source": [
    "Chapter 08\n",
    "# 两个输入、一个输出函数\n",
    "Book_1《编程不难》 | 鸢尾花书：从加减乘除到机器学习 "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "4fc5a11b-6b88-45ce-87c4-cfb195e646de",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 自定义函数\n",
    "def add_numbers(a, b):\n",
    "    result = a + b\n",
    "    return result"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "095a34bb-2bc7-46d0-b24b-ecf1ccae2bf0",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "8\n"
     ]
    }
   ],
   "source": [
    "sum = add_numbers(3, 5) # 调用函数\n",
    "print(sum)  # 输出8"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.10.9"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
